﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
using Lapkin.Attributes;

namespace Lapkin.Models.DataModels
{
    public class User
    {
        [Key]
        public Guid? Id { get; set; }

        [Required, MaxLength(200)]
        [Unique(typeof(MainContext), "Email", ErrorMessage = "Bad Email")]
        public String Email { get; set; }

        [Required, MaxLength(200)]
        public String Password { get; set; }

        [MaxLength(200)]
        public String Name { get; set; }

        public String Address { get; set; }

        [MaxLength(50)]
        public String Phone { get; set; }

        [Required]
        public Boolean? IsBanned { get; set; }

        [Required]
        public DateTime RegDate { get; set; }

        [Required]
        public DateTime LastActiveDate { get; set; }

        public virtual ICollection<Role> Roles { get; set; }
        public virtual ICollection<Order> Orders { get; set; }
    }
}